module enqueueUpdateMuxer16 (
    input wire clk,
    input wire rst,
    input wire enqueue_update_en_1,
    input wire enqueue_update_en_2,
    input wire enqueue_update_en_3,
    input wire enqueue_update_en_4,
    input wire enqueue_update_en_5,
    input wire enqueue_update_en_6,
    input wire enqueue_update_en_7,
    input wire enqueue_update_en_8,
    input wire enqueue_update_en_9,
    input wire enqueue_update_en_10,
    input wire enqueue_update_en_11,
    input wire enqueue_update_en_12,
    input wire enqueue_update_en_13,
    input wire enqueue_update_en_14,
    input wire enqueue_update_en_15,
    input wire enqueue_update_en_16,
    input wire [5:0] enqueue_update_priority_1,
    input wire [5:0] enqueue_update_priority_2,
    input wire [5:0] enqueue_update_priority_3,
    input wire [5:0] enqueue_update_priority_4,
    input wire [5:0] enqueue_update_priority_5,
    input wire [5:0] enqueue_update_priority_6,
    input wire [5:0] enqueue_update_priority_7,
    input wire [5:0] enqueue_update_priority_8,
    input wire [5:0] enqueue_update_priority_9,
    input wire [5:0] enqueue_update_priority_10,
    input wire [5:0] enqueue_update_priority_11,
    input wire [5:0] enqueue_update_priority_12,
    input wire [5:0] enqueue_update_priority_13,
    input wire [5:0] enqueue_update_priority_14,
    input wire [5:0] enqueue_update_priority_15,
    input wire [5:0] enqueue_update_priority_16,
    input wire [7:0] is_first_tail_1,
    input wire [7:0] is_first_tail_2,
    input wire [7:0] is_first_tail_3,
    input wire [7:0] is_first_tail_4,
    input wire [7:0] is_first_tail_5,
    input wire [7:0] is_first_tail_6,
    input wire [7:0] is_first_tail_7,
    input wire [7:0] is_first_tail_8,
    input wire [7:0] is_first_tail_9,
    input wire [7:0] is_first_tail_10,
    input wire [7:0] is_first_tail_11,
    input wire [7:0] is_first_tail_12,
    input wire [7:0] is_first_tail_13,
    input wire [7:0] is_first_tail_14,
    input wire [7:0] is_first_tail_15,
    input wire [7:0] is_first_tail_16,
    input wire [9:0] enqueue_tail_old_1,
    input wire [9:0] enqueue_tail_old_2,
    input wire [9:0] enqueue_tail_old_3,
    input wire [9:0] enqueue_tail_old_4,
    input wire [9:0] enqueue_tail_old_5,
    input wire [9:0] enqueue_tail_old_6,
    input wire [9:0] enqueue_tail_old_7,
    input wire [9:0] enqueue_tail_old_8,
    input wire [9:0] enqueue_tail_old_9,
    input wire [9:0] enqueue_tail_old_10,
    input wire [9:0] enqueue_tail_old_11,
    input wire [9:0] enqueue_tail_old_12,
    input wire [9:0] enqueue_tail_old_13,
    input wire [9:0] enqueue_tail_old_14,
    input wire [9:0] enqueue_tail_old_15,
    input wire [9:0] enqueue_tail_old_16,
    input wire [15:0] enqueue_tail_new_1,
    input wire [15:0] enqueue_tail_new_2,
    input wire [15:0] enqueue_tail_new_3,
    input wire [15:0] enqueue_tail_new_4,
    input wire [15:0] enqueue_tail_new_5,
    input wire [15:0] enqueue_tail_new_6,
    input wire [15:0] enqueue_tail_new_7,
    input wire [15:0] enqueue_tail_new_8,
    input wire [15:0] enqueue_tail_new_9,
    input wire [15:0] enqueue_tail_new_10,
    input wire [15:0] enqueue_tail_new_11,
    input wire [15:0] enqueue_tail_new_12,
    input wire [15:0] enqueue_tail_new_13,
    input wire [15:0] enqueue_tail_new_14,
    input wire [15:0] enqueue_tail_new_15,
    input wire [15:0] enqueue_tail_new_16,
    output reg enqueue_update_en,
    output reg [7:0] is_first_tail,
    output reg [9:0] enqueue_tail_old,
    output reg [15:0] enqueue_tail_new
);
    wire [3:0] enqueue_update_en_out;
    wire [5:0] enqueue_update_priority_out [0:3];
    wire [7:0] is_first_tail_out [0:3];
    wire [9:0] enqueue_tail_old_out [0:3];
    wire [15:0] enqueue_tail_new_out [0:3];


    enqueueUpdateMuxer4 mux1(.clk(clk), .rst(rst), 
                            .enqueue_update_en_1(enqueue_update_en_1), .enqueue_update_priority_1(enqueue_update_priority_1), .is_first_tail_1(is_first_tail_1), .enqueue_tail_old_1(enqueue_tail_old_1), .enqueue_tail_new_1(enqueue_tail_new_1), 
                            .enqueue_update_en_2(enqueue_update_en_2), .enqueue_update_priority_2(enqueue_update_priority_2), .is_first_tail_2(is_first_tail_2), .enqueue_tail_old_2(enqueue_tail_old_2), .enqueue_tail_new_2(enqueue_tail_new_2), 
                            .enqueue_update_en_3(enqueue_update_en_3), .enqueue_update_priority_3(enqueue_update_priority_3), .is_first_tail_3(is_first_tail_3), .enqueue_tail_old_3(enqueue_tail_old_3), .enqueue_tail_new_3(enqueue_tail_new_3), 
                            .enqueue_update_en_4(enqueue_update_en_4), .enqueue_update_priority_4(enqueue_update_priority_4), .is_first_tail_4(is_first_tail_4), .enqueue_tail_old_4(enqueue_tail_old_4), .enqueue_tail_new_4(enqueue_tail_new_4), 
                            .enqueue_update_en_out(enqueue_update_en_out[0]), .enqueue_update_priority_out(enqueue_update_priority_out[0]), .is_first_tail_out(is_first_tail_out[0]), .enqueue_tail_old_out(enqueue_tail_old_out[0]), .enqueue_tail_new_out(enqueue_tail_new_out[0]));
    
    enqueueUpdateMuxer4 mux2(.clk(clk), .rst(rst), 
                            .enqueue_update_en_1(enqueue_update_en_5), .enqueue_update_priority_1(enqueue_update_priority_5), .is_first_tail_1(is_first_tail_5), .enqueue_tail_old_1(enqueue_tail_old_5), .enqueue_tail_new_1(enqueue_tail_new_5), 
                            .enqueue_update_en_2(enqueue_update_en_6), .enqueue_update_priority_2(enqueue_update_priority_6), .is_first_tail_2(is_first_tail_6), .enqueue_tail_old_2(enqueue_tail_old_6), .enqueue_tail_new_2(enqueue_tail_new_6), 
                            .enqueue_update_en_3(enqueue_update_en_7), .enqueue_update_priority_3(enqueue_update_priority_7), .is_first_tail_3(is_first_tail_7), .enqueue_tail_old_3(enqueue_tail_old_7), .enqueue_tail_new_3(enqueue_tail_new_7), 
                            .enqueue_update_en_4(enqueue_update_en_8), .enqueue_update_priority_4(enqueue_update_priority_8), .is_first_tail_4(is_first_tail_8), .enqueue_tail_old_4(enqueue_tail_old_8), .enqueue_tail_new_4(enqueue_tail_new_8), 
                            .enqueue_update_en_out(enqueue_update_en_out[1]), .enqueue_update_priority_out(enqueue_update_priority_out[1]), .is_first_tail_out(is_first_tail_out[1]), .enqueue_tail_old_out(enqueue_tail_old_out[1]), .enqueue_tail_new_out(enqueue_tail_new_out[1]));

    enqueueUpdateMuxer4 mux3(.clk(clk), .rst(rst), 
                            .enqueue_update_en_1(enqueue_update_en_9), .enqueue_update_priority_1(enqueue_update_priority_9), .is_first_tail_1(is_first_tail_9), .enqueue_tail_old_1(enqueue_tail_old_9), .enqueue_tail_new_1(enqueue_tail_new_9), 
                            .enqueue_update_en_2(enqueue_update_en_10), .enqueue_update_priority_2(enqueue_update_priority_10), .is_first_tail_2(is_first_tail_10), .enqueue_tail_old_2(enqueue_tail_old_10), .enqueue_tail_new_2(enqueue_tail_new_10), 
                            .enqueue_update_en_3(enqueue_update_en_11), .enqueue_update_priority_3(enqueue_update_priority_11), .is_first_tail_3(is_first_tail_11), .enqueue_tail_old_3(enqueue_tail_old_11), .enqueue_tail_new_3(enqueue_tail_new_11), 
                            .enqueue_update_en_4(enqueue_update_en_12), .enqueue_update_priority_4(enqueue_update_priority_12), .is_first_tail_4(is_first_tail_12), .enqueue_tail_old_4(enqueue_tail_old_12), .enqueue_tail_new_4(enqueue_tail_new_12), 
                            .enqueue_update_en_out(enqueue_update_en_out[2]), .enqueue_update_priority_out(enqueue_update_priority_out[2]), .is_first_tail_out(is_first_tail_out[2]), .enqueue_tail_old_out(enqueue_tail_old_out[2]), .enqueue_tail_new_out(enqueue_tail_new_out[2]));

    enqueueUpdateMuxer4 mux4(.clk(clk), .rst(rst), 
                            .enqueue_update_en_1(enqueue_update_en_13), .enqueue_update_priority_1(enqueue_update_priority_13), .is_first_tail_1(is_first_tail_13), .enqueue_tail_old_1(enqueue_tail_old_13), .enqueue_tail_new_1(enqueue_tail_new_13), 
                            .enqueue_update_en_2(enqueue_update_en_14), .enqueue_update_priority_2(enqueue_update_priority_14), .is_first_tail_2(is_first_tail_14), .enqueue_tail_old_2(enqueue_tail_old_14), .enqueue_tail_new_2(enqueue_tail_new_14), 
                            .enqueue_update_en_3(enqueue_update_en_15), .enqueue_update_priority_3(enqueue_update_priority_15), .is_first_tail_3(is_first_tail_15), .enqueue_tail_old_3(enqueue_tail_old_15), .enqueue_tail_new_3(enqueue_tail_new_15), 
                            .enqueue_update_en_4(enqueue_update_en_16), .enqueue_update_priority_4(enqueue_update_priority_16), .is_first_tail_4(is_first_tail_16), .enqueue_tail_old_4(enqueue_tail_old_16), .enqueue_tail_new_4(enqueue_tail_new_16), 
                            .enqueue_update_en_out(enqueue_update_en_out[3]), .enqueue_update_priority_out(enqueue_update_priority_out[3]), .is_first_tail_out(is_first_tail_out[3]), .enqueue_tail_old_out(enqueue_tail_old_out[3]), .enqueue_tail_new_out(enqueue_tail_new_out[3]));

    //第二组仲裁器
    enqueueUpdateMuxer4 muxer(.clk(clk), .rst(rst), 
                            .enqueue_update_en_1(enqueue_update_en_out[0]), .enqueue_update_priority_1(enqueue_update_priority_out[0]), .is_first_tail_1(is_first_tail_out[0]), .enqueue_tail_old_1(enqueue_tail_old_out[0]), .enqueue_tail_new_1(enqueue_tail_new_out[0]), 
                            .enqueue_update_en_2(enqueue_update_en_out[1]), .enqueue_update_priority_2(enqueue_update_priority_out[1]), .is_first_tail_2(is_first_tail_out[1]), .enqueue_tail_old_2(enqueue_tail_old_out[1]), .enqueue_tail_new_2(enqueue_tail_new_out[1]), 
                            .enqueue_update_en_3(enqueue_update_en_out[2]), .enqueue_update_priority_3(enqueue_update_priority_out[2]), .is_first_tail_3(is_first_tail_out[2]), .enqueue_tail_old_3(enqueue_tail_old_out[2]), .enqueue_tail_new_3(enqueue_tail_new_out[2]), 
                            .enqueue_update_en_4(enqueue_update_en_out[3]), .enqueue_update_priority_4(enqueue_update_priority_out[3]), .is_first_tail_4(is_first_tail_out[3]), .enqueue_tail_old_4(enqueue_tail_old_out[3]), .enqueue_tail_new_4(enqueue_tail_new_out[3]), 
                            .enqueue_update_en_out(enqueue_update_en), .enqueue_update_priority_out(), .is_first_tail_out(is_first_tail), .enqueue_tail_old_out(enqueue_tail_old), .enqueue_tail_new_out(enqueue_tail_new));
endmodule